<template>
	<view class="detailsBox">
		<!-- <view class="detailsNav">
			<view class="staBox" :class="status==0?'staBoxa':status==1?'staBox':status==2?'staBoxb':''">
				{{status==0?'已审核':status==1?'未审核':status==2?'拒绝':''}}
			</view>
			<image v-if="status!=0" src="/static/pages/index/modifyImg.png" class="modifyImg" mode=""></image>
		</view> -->
		<!-- 详情区 -->
		<view class="detailsContent" v-if="form !== null">
			<view class="detislNa">
				<view class="na">
					姓名：
				</view>
				<view class="naC">
					{{form.name}}
				</view>
			</view>
			<view class="detislNa">
				<view class="na">
					性别：
				</view>
				<view class="naC">
					{{gender}}
				</view>
			</view>
			<view class="detislNa">
				<view class="na">
					年纪：
				</view>
				<view class="naC">
					{{form.age}}
				</view>
			</view>
			<view class="detislNa">
				<view class="na">
					电话：
				</view>
				<view class="naC">
					{{form.mobile}}
				</view>
			</view>
			<view class="detislNa">
				<view class="na">
					预算：
				</view>
				<view class="naC">
					{{form.budget}}
				</view>
			</view>
			<view class="detislNaa">
				<view class="na">
					意向车型：
				</view>
				<view class="naC">
					{{form.cat_type}}
				</view>
			</view>
			<view class="detislNa">
				<view class="na">
					颜色：
				</view>
				<view class="naC">
					{{form.colour}}
				</view>
			</view>
			<view class="detislNa">
				<view class="na">
					用途：
				</view>
				<view class="naC">
					{{form.purpose}}
				</view>
			</view>
			<view class="detislNa">
				<view class="na">
					时间：
				</view>
				<view class="naC">
					{{form.createtime | formatDate}}
				</view>
			</view>
			<view class="detislNa">
				<view class="na">
					备注：
				</view>
				<view class="naC">
					{{form.remark}}
				</view>
			</view>
			<!-- <view class="detislNaa" v-if="status==2">
				<view class="na">
					拒绝原因：
				</view>
				<view class="naC">
					此区域不开展此活动
				</view>
			</view> -->
		</view>
		<view class="zwsj" v-if="form == null">
			暂无数据
		</view>
	</view>
</template>

<script>
	import {details} from '@/request/api.js'
	export default {
		data() {
			return {
				gender:'',
				id:'',//状态
				form:{}
			};
		},
		onLoad(option) {
			// console.log(option)
			console.log();
			this.id = option.id
			this.OnList()
		},
		onShow() {
			
		},
		methods:{
			OnList(){
				details({
					id:this.id,
				}).then(res => {
					console.log(res);
					this.form = res.data
					// if(this.form.gender == "1"){
					// 	this.gender = "男"
					// }else if(this.form.gender == "2"){
					// 	this.gender = "女"
					// }
					uni.showToast({
						title: res.msg,
						icon: "none"
					})
				})
			},
		},
		filters: {
			formatDate: function(value) {
				let date = new Date(value * 1000);
				//时间戳为10位需*1000，时间戳为13位的话不需乘1000
				let y = date.getFullYear();
				let MM = date.getMonth() + 1;
				MM = MM < 10 ? ('0' + MM) : MM; //月补0
				let d = date.getDate();
				d = d < 10 ? ('0' + d) : d; //天补0
				let h = date.getHours();
				h = h < 10 ? ('0' + h) : h; //小时补0
				let m = date.getMinutes();
				m = m < 10 ? ('0' + m) : m; //分钟补0
				let s = date.getSeconds();
				s = s < 10 ? ('0' + s) : s; //秒补0
				console.log(y + '-' + MM + '-' + d);
				return y + '-' + MM + '-' + d; //年月日
		
			}
		},
	}
</script>

<style lang="scss">
	page{
		background-color: #FFFFFF;
	}
.detailsBox{
	width: 100%;
	box-sizing: border-box;
	padding-bottom: 40rpx;
	overflow: hidden;
	.detailsNav{
		width: 100%;
		display: flex;
		justify-content: space-between;
		height: 120rpx;
		
		.staBox{
			width: 120rpx;
			height: 50rpx;
			background: #F69518;
			border-radius: 0rpx 25rpx 0rpx 25rpx;
			font-size: 28rpx;
			font-family: PingFang SC;
			font-weight: 500;
			color: #F5F5F5;
			line-height: 50rpx;
			text-align: center;
			margin: 35rpx 0 0 40rpx;
		}
		.staBoxa{
			width: 120rpx;
			height: 50rpx;
			background: #1855F6;
			border-radius: 0rpx 25rpx 0rpx 25rpx;
			font-size: 28rpx;
			font-family: PingFang SC;
			font-weight: 500;
			color: #F5F5F5;
			line-height: 50rpx;
			text-align: center;
			margin: 35rpx 0 0 40rpx;
		}
		.staBoxb{
			width: 120rpx;
			height: 50rpx;
			background: #f61861;
			border-radius: 0rpx 25rpx 0rpx 25rpx;
			font-size: 28rpx;
			font-family: PingFang SC;
			font-weight: 500;
			color: #F5F5F5;
			line-height: 50rpx;
			text-align: center;
			margin: 35rpx 0 0 40rpx;
		}
		.modifyImg{
			width: 48rpx;
			height: 48rpx;
			margin-right: 40rpx;
			margin-top: 36rpx;
		}
	}
	.detailsContent{
		width: 100%;
		overflow: hidden;
		.detislNa{
			display: flex;
			margin-top: 60rpx;
			.na{
				font-size: 36rpx;
				font-family: PingFang SC;
				font-weight: 500;
				color: #303133;
				margin-left: 40rpx;
			}
			.naC{
				font-size: 36rpx;
				font-family: PingFang SC;
				font-weight: 500;
				color: #303133;
				margin-left: 186rpx;
			}
		}
		.detislNaa{
			display: flex;
			margin-top: 60rpx;
			.na{
				font-size: 36rpx;
				font-family: PingFang SC;
				font-weight: 500;
				color: #303133;
				margin-left: 40rpx;
			}
			.naC{
				font-size: 36rpx;
				font-family: PingFang SC;
				font-weight: 500;
				color: #303133;
				margin-left: 113rpx;
			}
		}
	}
	.zwsj{
		width: 100%;
		text-align: center;
		margin-top: 20rpx;
	}
}
</style>
